#include <stdio.h>

int main()
{
  int A, B, C, D, H;
  for (A = 3; A <= 9; A++)
    for (D = 1; D <= 9; D++)
    {
      H = D * 100000 + D * 10000 + D * 1000 + D * 100 + D * 10 + D;
      if (H % A == 0)
      {
        int K;
        K = H / A;
        if ((K / 10000 == A) && (K / 10 % 10 == A) &&
            ((K / 1000 % 10) == (K % 10)))
        {
          printf("%d*%d=%d\n", K, A, H);
        }
      }
    }
  return 0;
}